import os
path="/local/climate_2012/lauren-output/"
dirList=os.listdir(path)
scenarios=[]
gcms=[]
for file in dirList:
    if file.startswith("JCU"):
        fname=file.split('-')
        scenarios=fname[4]
        gcms=fname[5] + '-' + fname[6]
        for scenario in scenarios:
            for gcm in gcms:
                print scenario + ' ' + gcm
